package com.guit.demo.client.attacher;

import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.Widget;

import com.guit.client.View;

public class RootLayoutPanelAttacherImpl implements RootLayoutPanelAttacher {

  @Override
  public void attach(View view) {
    RootLayoutPanel root = RootLayoutPanel.get();
    root.clear();

    assert view instanceof Widget : "You only can attach widget or composite views";

    root.add((Widget) view);
  }
}
